// index.less

@primary-color: #333;
@secondary-color: #555;
@background-color: #f0f0f0;
@border-color: #ccc;
@hover-background-color: #e0e0e0;
@item-background-color: #fff;
@item-border-color: #ddd;
@item-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
@padding: 20px;
@gap: 20px;
@mobile-padding: 10px;
@mobile-gap: 10px;
@tablet-padding: 15px;
@tablet-gap: 15px;

.photo-albums-main {
    width: 100%;
    margin: 0 auto;
    padding: @padding;
    box-sizing: border-box;

    .photo-albums-title {
        font-size: 24px;
        font-weight: bold;
        color: @primary-color;
        margin-bottom: @gap;

        .photo-albums-title-main {
            display: block;
        }

        .photo-albums-title-description {
            display: block;
            font-size: 16px;
            color: @secondary-color;
            margin-top: 5px;
        }
    }

    .photo-albums-content {
        display: flex;
        flex-direction: column;
        gap: @gap;

        .photo-albums-upload {
            width: calc(20% - @gap);
            background-color: @background-color;
            border: 2px dashed @border-color;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background-color 0.3s;

            &:hover {
                background-color: @hover-background-color;
            }

            span {
                font-size: 16px;
                color: @secondary-color;
            }
        }

        .photo-albums-list {
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            gap: @gap;

            .photo-albums-item {
                width: calc(20% - @gap);
                background-color: @item-background-color;
                border: 1px solid @item-border-color;
                border-radius: 4px;
                overflow: hidden;
                box-shadow: @item-shadow;

                .photo-albums-item-img {
                    width: 100%;
                    height: 0;
                    padding-bottom: 100%; // 1:1 aspect ratio
                    position: relative;

                    .photo-albums-item-img-utils {
                        position: absolute;
                        top: 10px;
                        right: 10px;
                        z-index: 2;
                        color: rgba(255, 255, 255, 0.5);
                        background: #00000059;
                        padding: 5px 10px;
                        border-radius: 10px;

                        >span {
                            cursor: pointer;
                        }

                        >span:hover {
                            color: white;
                            transform: scale(1.2);
                        }
                    }

                    img {
                        width: 100%;
                        height: 100%;
                        object-fit: cover;
                        position: absolute;
                        z-index: 1;
                        top: 0;
                        left: 0;
                    }
                }

                .photo-albums-item-name {
                    padding: 10px;
                    text-align: center;

                    span {
                        font-size: 16px;
                        color: @secondary-color;
                    }
                }
            }
        }
    }
}

// 媒体查询：手机端（最大宽度767px）
@media screen and (max-width: 767px) {
    .photo-albums-main {
        padding: @mobile-padding;

        .photo-albums-title {
            font-size: 20px;
            margin-bottom: @mobile-gap;

            .photo-albums-title-description {
                font-size: 14px;
            }
        }

        .photo-albums-content {
            gap: @mobile-gap;

            .photo-albums-upload {
                width: 100%;
                min-height: 150px;
            }

            .photo-albums-list {
                .photo-albums-item {
                    width: 100%;
                }
            }
        }
    }
}

// 媒体查询：平板端（最小宽度768px，最大宽度1023px）
@media screen and (min-width: 768px) and (max-width: 1023px) {
    .photo-albums-main {
        padding: @tablet-padding;

        .photo-albums-title {
            font-size: 22px;
            margin-bottom: @tablet-gap;

            .photo-albums-title-description {
                font-size: 15px;
            }
        }

        .photo-albums-content {
            gap: @tablet-gap;

            .photo-albums-upload {
                width: calc(50% - @tablet-gap);
                min-height: 180px;
            }

            .photo-albums-list {
                .photo-albums-item {
                    width: calc(50% - @tablet-gap);
                }
            }
        }
    }
}